<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>自定义指令</title>
</head>
<body>

<div id="app">
  <input type="text" v-focus>
</div>

<script src="../lib/vue.js"></script>
<script>
  Vue.directive('focus', function (el) {
    el.focus();
  })
  let vm = new Vue({
    el: '#app',
  })
</script>
</body>
</html>